package ran.friend.controller.file;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import ran.entity.Result;
import ran.file.domain.OSSResult;
import ran.friend.service.file.IFileService;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ran
 * Date: 2025-11-18
 * Time: 18:25
 */
@RestController
@RequestMapping("/file")
public class FileController {
    @Autowired
    private IFileService fileService;

    @RequestMapping("/upload")
    public Result<OSSResult> upload(@RequestBody MultipartFile file) {
        return Result.ok(fileService.upload(file));
    }
}
